package com.shiwaixiangcun.customer.module.intelligent

import android.os.Bundle
import com.shiwaixiangcun.customer.R
import com.shiwaixiangcun.customer.base.BaseActivity
import kotlinx.android.synthetic.main.activity_bind_camera.*
import kotlinx.android.synthetic.main.top_bar_white.*

/**
 * 绑定摄像头
 * 创建名称页面
 */
class BindCameraActivity : BaseActivity() {
    private var deviceId: String? = null
    private var deviceName: String? = null
    private var deviceRc: String? = null


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_bind_camera)
        deviceId = intent.extras.getString("device_id")
        deviceName = intent.extras.getString("device_name")
        deviceRc = intent.extras.getString("device_rc")
        initView()

    }


    private fun initView() {

        tv_page_name.text = "创建名称和密码"
        back_left.setOnClickListener { finish() }
        btn_add_device.setOnClickListener {
            if (edt_camera_name.text.toString().isEmpty()) {
                showToastShort("请输入摄像头的名称")
            } else {

                intent.setClass(this, ValidateNetworkActivity::class.java)
                intent.putExtra("camera_name", edt_camera_name.text.toString())
                intent.putExtra("camera_id", deviceId)
                intent.putExtra("camera_rc", deviceRc)
                startActivity(intent)


            }
        }

    }


}
